<?php

// +----------------------------------------------------------------------
// | EasyAdmin
// +----------------------------------------------------------------------
// | PHP交流群: 763822524
// +----------------------------------------------------------------------
// | 开源协议  https://mit-license.org
// +----------------------------------------------------------------------
// | github开源项目：https://github.com/zhongshaofa/EasyAdmin
// +----------------------------------------------------------------------

namespace addons\mall\model;

use app\common\model\TimeModel;

class Goods extends TimeModel
{
    protected $name = 'mall_goods';

    public function cate()
    {
        return $this->belongsTo(Cate::class, 'cate_id', 'id');
    }

    public function setSpecsAttr($value)
    {

        return implode(',', $value);
    }

    public function setSkusAttr($value)
    {
        return json_encode($value);
    }

    public function setSpecsValueAttr($value)
    {

        return json_encode($value);
    }
}
